<template>
  <el-tooltip :content="tooltip" placement="top" effect="dark" :show-after="300">
    <el-button class="floating-action-button" type="primary" circle @click="$emit('click')">
      <el-icon><Plus /></el-icon>
    </el-button>
  </el-tooltip>
</template>

<script setup lang="ts">
import { Plus } from '@element-plus/icons-vue'

defineProps<{
  tooltip: string
}>()

defineEmits<{
  (e: 'click'): void
}>()
</script>

<style scoped lang="scss">
.floating-action-button {
  position: fixed;
  right: 70px;
  bottom: 100px;
  font-size: 24px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  &.el-button.is-circle {
    width: 52px !important;
    height: 52px !important;
  }

  &:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  :deep(.el-icon) {
    font-size: 24px;
    margin: 0;
  }
}
</style>
